<template>
	<view class="app">
		<view class="content">
			<view class="title">
				{{news.title}}
			</view>
			<view class="app2">
				<view class="author">
					编辑：{{news.author}}
				</view>
				<view>
					发布时间：{{news.posttime}}
				</view>
			</view>
			<view class="newsContent">
				<rich-text :nodes="news.content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import {parseTime} from '@/utils/ruoyi.js'
	
	export default {
		data() {
			return {
				options:null,
				news:[]
			};
		},
		onLoad(e){
			// console.log(e);
			this.options = e;
			this.getDetail()
		},
		methods:{
			getDetail(){
				uni.request({
				    url: 'https://ku.qingnian8.com/dataApi/news/detail.php',
					data:{
						cid:this.options.cid,
						id:this.options.id
					},
				    success: (res) => {
						this.news = res.data
						this.news.posttime = parseTime(res.data.posttime)
				    }
				});
			}
		}
	}
</script>

<style lang="scss">
	.content{
		padding: 30rpx;
		
		
		.app2{
			display: flex;
			justify-content: space-between;
			font-size: 28rpx;
			color: #CCC;
			padding:20rpx 0;
		}
	}
</style>
